package com.leankit.kanban.api.client.library.transferobjects;

import java.util.List;

public class Card {
    public long Id;
    //[DomainIdentityValidation]
    public long LaneId;
    //[Required(ErrorMessage = "Title may not be empty")]
    //[StringLength(255, ErrorMessage = "Title may have 255 symbols only")]
    public String Title;
    //[StringLength(2000, ErrorMessage = "Description may have 2000 symbols only")]
    public String Description;
    public String CreatedOn;
    public String TypeName;
    //[DomainIdentityValidation]
    public long TypeId;
    public int Priority;
    public int Size;
    public boolean Active;
    public String Color;
    public int Version;
    public boolean IsBlocked;
    public String BlockReason;
    public int Index;
    public String DueDate;
    public String UserWipOverrideComment;
    public String ExternalSystemName;
    //[StringLength(2000, ErrorMessage = "ExternalSystemUrl may have 2000 symbols only")]
    public String ExternalSystemUrl;
    public String Tags;
    //[DomainIdentityValidation]
    public Long ClassOfServiceId;
    //[StringLength(50, ErrorMessage = "ExternalSystemUrl may have 50 symbols only")]
    public String ExternalCardID;
    //[DomainIdentityValidation]
    public long[] AssignedUserIds;
    public List<Comment> Comments;
    public List<CardEvent> HistoryEvents;

    public CardView ToCardView()
    {
    	CardView cardView = new CardView();
        cardView.setId(this.Id);
        cardView.setActive(this.Active);
        cardView.setClassOfServiceId(this.ClassOfServiceId);
        cardView.setBlockReason(this.BlockReason);
        cardView.setDescription(this.Description);
        cardView.setDueDate(this.DueDate);
        cardView.setExternalCardID(this.ExternalCardID);
        cardView.setExternalSystemName(this.ExternalSystemName);
        cardView.setIndex(this.Index);
        cardView.setIsBlocked(this.IsBlocked);
        cardView.setLaneId(this.LaneId);
        
        //TODO: fix
        //cardView.setPriority((PriorityType) this.Priority);
        
        cardView.setSize(this.Size);
        cardView.setTags(this.Tags);
        cardView.setTitle(this.Title);
        cardView.setTypeId(this.TypeId);
        cardView.setVersion(this.Version);
        //cardView.setAssignedUsers(this.AssignedUserIds
        cardView.setComments(Comments);
        cardView.setHistoryEvents(HistoryEvents);

        return cardView;
    }

}
